<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0030)http://localhost:8080/House-2/ -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>云和租房 - 首页</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<LINK rel=stylesheet type=text/css href="../css/style.css">
<META name=GENERATOR content="MSHTML 8.00.7601.17514">
<script type="text/javascript" src="/jquery/jquery-1.8.3.js"></script>
<script>
function changeArea(val) {
	alert(val);
	checkStreet(val);
}

init();

function init() {
	$(function() {
		$.ajax({
			type : "POST",
			url : "/json/get_getType",
			data : {},
			success : function(data) {
				var $suggest="<OPTION selected value=''>请选择</OPTION>";
				$.each(data.typeList,function(i, val) {
					$suggest +="<OPTION value="+val.typeid+">"+val.typename+"</OPTION>";
				});
				$("#type").html($suggest);
			}
		});
	}); 
	$(function () {
		$.ajax({
			type : "POST",
			url : "/json/get_getArea",
			data : {},
			success : function(data) {
				var $sug="<OPTION selected value=''>请选择</OPTION>";
				$.each(data.areaList,function(i, val) {
					$sug +="<OPTION value="+val.areaid+">"+val.areaname+"</OPTION>";
				});
				$("#area").html($sug);
			}
		});
	}) 
}
function checkStreet(v) {
	$(function () {
		$.ajax({
			type : "POST",
			url : "/json/get_getStreet",
			data : {
				areaid:v
			},
			success : function(data) {
				var $s="<OPTION selected value=''>请选择</OPTION>";
				$.each(data.streetList,function(i, val) {
					$s +="<OPTION value="+val.streetid+">"+val.streetname+"</OPTION>";
				});
				$("#street").html($s);
			}
		})
		
	})
}
 
 
</script>
</HEAD>
<BODY>
<DIV id=header class=wrap>
<DIV id=logo><IMG src="../images/logo.gif"></DIV></DIV>

<!-- 条件搜索 -->
<DIV id=navbar class=wrap>
<DL class="search clearfix">
  <FORM id=sform method=post >
  
  <DT>
  <UL>
    <LI class=bold>房屋信息</LI>
    <LI>标题：<INPUT id=title type=text name=title> 
      <LABEL class=ui-blue>
        <INPUT onclick="chaxun()" value=搜索房屋 type=button name=search>
      </LABEL> 
    </LI>
  </UL>
  </DT>
  
  <DD>
    <UL>
      <LI class=first>价格 </LI>
      <LI>
	    <SELECT name=price id="price">
	      <OPTION selected value="">不限</OPTION>
	      <OPTION value=0-500>0-500</OPTION> 
	      <OPTION value=500-1000>500-1000</OPTION>
	      <OPTION value=1000-2000>1000-2000</OPTION>
	      <OPTION value=2000-5000>2000-5000</OPTION>
	      <OPTION value=5000-10000>5000以上</OPTION> 
	    </SELECT> 
      </LI>
    </UL>
  </DD>
      
      
  <DD>
  <UL>
    <LI class=first>房屋位置(区)</LI>
    <LI>
      <SELECT id=area name=area  onchange="changeArea(this.value)"> 
        <OPTION selected value="">不限</OPTION>
      </SELECT> </LI></UL></DD>
  
  <DD>
  <UL>
    <LI class=first>房屋位置(街道)</LI>
    <LI>
      <SELECT id=street name=street > 
        <OPTION selected value="">不限</OPTION>
      </SELECT> </LI></UL></DD>   
   
  <DD>
  <UL>
    <LI class=first>房型</LI>
    <LI>
      <SELECT name=type id="type"> 
        <OPTION selected value="">不限</OPTION> 
      </SELECT> 
  </LI></UL></DD>
  <DD>
    <UL>
      <LI class=first>面积 </LI>
      <LI>
	    <SELECT name=floorage id=floorage> 
	      <OPTION selected value="">不限</OPTION> 
	      <OPTION value=0-50>0-50</OPTION>
	      <OPTION value=50-100>50-100</OPTION> 
	      <OPTION value=100-500>100-500</OPTION>
	      <OPTION value=500-10000>500以上</OPTION>
	    </SELECT> 
	  </LI>
	</UL>
  </DD>
</FORM></DL>
</DIV>
      
      
<DIV class="main wrap">
<TABLE class=house-list>
  <TBODY id="tbody">
  <b>没有租房信息</b>

<script>

checkHouseByTiaoJian('1');
function chaxun() {
	checkHouseByTiaoJian('1');
}

function checkHouseByTiaoJian(page) {
	$(function() {
		$.ajax({
			type : "POST",
			url : "/json/query_getHouseByTiaoJian",
			data : {
				title:$("#title").val(),
				area : $("#area").val(), 
				street : $("#street").val(),
				type : $("#type").val(),
				floorage : $("#floorage").val(),
				price : $("#price").val(),
				pageIndex : page
			},
			success : function(data) {
				var $sugg="";
				$.each(data.houseList,function(i, val) {
					$sugg +="<TR>";
					$sugg +="<TD class=house-thumb><span><A href='getHouse!getHouseById.action?id="+val.houseid+"' target='_blank'>"
					$sugg +="<img src='/images/"+val.pic+"' width='100' height='75' alt=''></A></SPAN></TD><TD>";
					$sugg +="<DL>";
					$sugg +="<DT><A href='getHouse!getHouseById.action?id="+val.houseid+"' target='_blank'>"+val.title+"</A></DT>";
					$sugg +="<DD>"+val.street.streetname+val.street.area.areaname+","+val.floorage+"m²<BR>联系方式："+val.contact+"</DD></DL></TD>";
					$sugg +="<TD class=house-type>"+val.type.typename+"</TD>";
					$sugg +="<TD class=house-price><SPAN>"+val.price+"</SPAN>元/月</TD>";
					$sugg +="</TR>";
				});
				$("#tbody").html($sugg);
				$("#shouYe").attr("onclick","checkHouseByTiaoJian('1')");
				$("#shangYiYe").attr("onclick",
						"checkHouseByTiaoJian(" + (data.currPage - 1) + ")");
				$("#xiaYiYe").attr("onclick",
						"checkHouseByTiaoJian(" + (data.currPage + 1) + ")");
				$("#weiYe").attr("onclick","checkHouseByTiaoJian(" + (data.totalPage) + ")");
				$("#totalPage").html(data.totalPage);
				$("#pageIndex").html(data.currPage);
			},
			error:function(){
				$("#tbody").html("111");
			}
		});
	});
}
 
 
</script>  
    
    
  <!-- <TR class=odd>
    <TD class=house-thumb><span><A href="details.htm" target="_blank"><img src="../images/thumb_house.gif" width="100" height="75" alt=""></a></span></TD>
    <TD>
      <DL>
        <DT><A href="details.htm" target="_blank">大房子</A></DT>
        <DD>海淀区中关村大街,100平米<BR>联系方式：123456789 </DD></DL></TD>
    <TD class=house-type>一室一厅</TD>
    <TD class=house-price><SPAN>230.0</SPAN>元/月</TD></TR>
  
  <TR>
    <TD class=house-thumb><span><A href="details.htm" target="_blank"><img src="../images/thumb_house.gif" width="100" height="75" alt=""></a></span></TD>
    <TD>
      <DL>
        <DT><A href="details.htm" target="_blank">123</A></DT>
        <DD>海淀区中关村大街,123平米<BR>联系方式：123 </DD></DL></TD>
    <TD class=house-type>一室一厅</TD>
    <TD class=house-price><SPAN>123.0</SPAN>元/月</TD></TR>
  
  <TR class=odd>
    <TD class=house-thumb><span><A href="details.htm" target="_blank"><img src="../images/thumb_house.gif" width="100" height="75" alt=""></a></span></TD>
    <TD>
      <DL>
        <DT><A href="details.htm" target="_blank">jjjj</A></DT>
        <DD>海淀区中关村大街,123平米<BR>联系方式：ff </DD></DL></TD>
    <TD class=house-type>一室一厅</TD>
    <TD class=house-price><SPAN>123.0</SPAN>元/月</TD></TR> -->
  
  </TBODY>
</TABLE>
  
<DIV class=pager>
<UL>
  <LI class=current><A href="#" id="shouYe" onclick="checkHouse('1')">首页</A></LI>
  <LI><A href="#" id="shangYiYe" onclick="checkHouse()">上一页</A></LI>
  <LI><A href="#" id="xiaYiYe" onclick="checkHouse()">下一页</A></LI>
  <LI><A href="#" id="weiYe" onclick="checkHouse()">末页</A></LI></UL><SPAN 
class=total><b id="pageIndex"></b>/<b id="totalPage"></b>页</SPAN> </DIV></DIV>
<DIV id=footer class=wrap>
<DL>
  <DT>云和租房 © 2010 云和 京ICP证1000001号</DT>
  <DD>关于我们 · 联系方式 · 意见反馈 · 帮助中心</DD></DL></DIV></BODY></HTML>
